// @ts-nocheck
/**
 * @Date: 2022-04-06 15:08:23
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-04-13 10:14:51
 * @FilePath: \weibo-api\model\users.js
 * @Description: something
 */
const sequelize = require("../db/seq");
const { DataTypes } = require("sequelize");
//创建模型 表名字为'user'
const User = sequelize.define("user", {
  userName: {
    type: DataTypes.STRING,
    allowNull: false,
    //不能重复
    unique: true,
  },
  password: {
    type: DataTypes.STRING,
    allowNull: false, //是否可以为空
  },
  nickName: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  gender: {
    type: DataTypes.STRING,
    allowNull: false,
    defaultValue: "3",
    comment: "性别 (1 男 2 女 3 保密)",
  },
  avatar: {
    type: DataTypes.STRING,
    defaultValue:
      "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
    comment: "头像",
  },
  city: {
    type: DataTypes.STRING,
    comment: "城市",
  },
  description: {
    type: DataTypes.TEXT,
    comment: "用户简介",
  },
  birthday: {
    type: DataTypes.STRING,
    comment: "生日",
  },
});

module.exports = User;
